extends AttributeReaction



@export var _magnification: float = 1.5
var _certain_critical: bool
var _attr: DamageInfo.DamageAttribute


func _ready() -> void:
    var target := get_parent().get_parent() as Character
    target.handle_damage_signals.before_calc_receive_damage.connect(
        func(info: DamageInfo) -> void:
            if not _certain_critical or _attr != info.attribute: return

            info.critical_rate = 1.0
            # info.critical_degree *= 1.5
            _certain_critical = false
            pass
    )


## 实现效果
func effect(info: DamageInfo) -> void:
    info.damage *= _magnification
    _attr = info.attribute
    _certain_critical = true
    ## TODO 添加提示图标
    pass

